<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <style>
        * {
            margin: 0;
            padding: 0;
            outline: 0;
        }

        .search_box {
            border: 1px solid #ccc;
            margin: 50px 10px;
        }

        .search_fl {
            overflow: hidden;
        }

        .search_txt {
            width: 100%;
            border: 0;
            height: 30px;
            padding: 2px 0 2px 5px;
        }

        .btn {
            background: #ccc;
            border: 0;
            width: 50px;
            height: 30px;
            float: right;
        }
    </style>
</head>


<body>
    <div class="search_box">
        <form onsubmit="return baiduWithHttps(this)" action="http://www.baidu.com/baidu" target="_blank">
            <input name="tn" type="hidden" value="SE_zzsearchcode_shhzc78w">
            <input type="submit" value="搜索" class="btn">
            <div class="search_fl">
                <input type="text" onfocus="checkHttps" name="word" class="search_txt">
            </div>

        </form>
    </div>
</body>
<script src="http://s1.bdstatic.com/r/www/cache/global/js/BaiduHttps_20150714_zhanzhang.js"></script>
<script>
    function checkHttps() {
        BaiduHttps.useHttps();
    };
    function baiduWithHttps(formname) {
        var data = BaiduHttps.useHttps();
        if (data.s === 0) {
            return true;
        }
        else {
            formname.action = 'https://www.baidu.com/baidu' + '?ssl_s=1&ssl_c' + data.ssl_code;
            return true;
        }
    };

</script>

</html>
